Python | Flatten and Reverse Sort Matrix
The flattening of list of list has been discussed many times, but sometimes, in addition to flattening, it is also required to get the string in reverse sorted manner. Let’s discuss certain ways in which this can be done....
read more
Python | Case Counter in String
Sometimes, while working with Python String, we can have a problem in which we need to separate the lower and upper case count. This kind of operation can have its application in many domains. Let’s discuss certain ways in which this task can be done....
read more
Length of race track based on the final distance between participants
Given three integers A, B, and C, the task is to find the length of a race track if 3 racers are competing in a race where the first racer beats the second racer by A meters, the first racer beats the third racer by B meters and the second racer beats the third by C meters....
read more
How to Compare Two Dictionaries in Python?
In this article, we will discuss how to compare two dictionaries in Python. As we all know what is a dictionary, but sometimes we may need to compare two dictionaries. Let’s see different methods to do the same....
read more
Check if the given push and pop sequences of Stack is valid or not
Given push[] and pop[] sequences with distinct values. The task is to check if this could have been the result of a sequence of push and pop operations on an initially empty stack. Return “True” if it otherwise returns “False”....
read more
Python Program to calculate sum and average of three numbers
We are given three numbers, and our task is to calculate the sum and average of these numbers. The average of the numbers is defined as the sum of the given numbers divided by the total number of elements. In this case, it will be the sum of given three numbers divided by 3....
read more
Check if all the 1s in a binary string are equidistant or not in Python
We are given a binary string, we have to check if the distance between every two 1s is the same or not. Below are a few examples to understand the problem clearly....
read more
Techniques to Find Consecutive 1s or 0s in a Python String
We are given a binary string and a number m, and we have to check if the string has m consecutive 1’s or 0’s. Below are a few examples to understand the problem statement clearly....
read more
Rearrange a Binary String with Alternating 0s and 1s in Python
We are given a binary string and we have to check whether it is possible to rearrange the string with alternate 0s and 1s. Below are a few examples to understand the problem statement clearly....
read more
Removing Tuples from a List by First Element Value in Python
Given a list of tuples, we need to delete tuples based on a specific condition related to their first element. In this article, we will explore three different approaches to deleting a tuple from a list of tuples based on the first element in Python....
read more
Check Multiple Variables against Single Value
Sometimes there comes a situation where we want to check multiple values for equality against a single value. In Python programming, this can be done by using various operators and functions. In this article, we will see different ways to test multiple variables for equality against a single variable in Python....
read more
Python Program to Print All Pronic Numbers Between 1 and 100
Pronic numbers are also called oblong numbers or rectangular numbers. They are produced by multiplying two successive integers. Mathematically, it can be written as n * (n + 1), where n is a positive integer....
read more